import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.swing.JFrame;

import classictravellersalesman.ClassicTravellerPath;
import classictravellersalesman.RealGraph;

import GUI.GUIPane;
import GUI.GUISimulatedAnneling;
import GUI.IVizualizer;

import stochastic.SimulatedAnealing;
import travellersalesman.ExtendetGraph;
import travellersalesman.GraphPanel;
import travellersalesman.RealExtendetGraph;
import travellersalesman.TravellerPath;
public class Programm {

	/**
	 * @param args
	 */
	public static void main(String[] args) 
		throws IOException
	{
		InputStream graphFile = new FileInputStream("test/realTSP/kroA100.tsp");
		RealGraph gr = new RealGraph(graphFile);
		ClassicTravellerPath p = new ClassicTravellerPath(gr);
		SimulatedAnealing alg = new SimulatedAnealing(p);
		//GUISimulatedAnneling gui = new GUISimulatedAnneling(alg);
		//IVizualizer iv = new classictravellersalesman.GraphPanel();
		//gui.setVisualizer(iv);
		long t = System.currentTimeMillis();
		//alg.CUDAStart();
		alg.CPUParallelStart();
		//alg.start();
		
		System.out.println("Time:" + (System.currentTimeMillis()-t));
		System.out.println("Cost:" + alg.getSolution().getCost());
	}

}
